import React, { Component } from 'react';
import { Card, Tabs ,message} from 'antd'
import Login from './Login'
import Enroll from './Enroll'
import '../../assets/styles/loginindex.css'
const { TabPane } = Tabs



class Index extends Component {
    render() {
        return (

            <div className="container">
                < div  className="bg1"></div>
                <div className='bear'></div>
            <Card className="card " >
                <Tabs defaultActiveKey="1" centered size='large' tabBarGutter={90}>

                    <TabPane tab="登陆" key="1">
                        <Login />
                    </TabPane>
                    <TabPane tab="注册" key="2">
                        <Enroll />
                    </TabPane>
                </Tabs>
            </Card>
        </div>
        );
    }
    componentDidMount() {
        if (localStorage.getItem('jwt')) {
            message.success('你已经登录过了！',1,()=>{
                this.props.history.replace('/dashboard/welcome')
            })
            // message.error('你已经登录过了！')
            // window.location.replace("/dashboard/welcome")
        }
    }
    
}

export default Index;


